package com.yx1996.test.day02;


import com.yx1996.bean.day02.proxy.UserServiceProxyFactory;
import com.yx1996.bean.day02.service.UserService;
import com.yx1996.bean.day02.service.UserServiceImpl;
import org.junit.Test;

//测试动态代理技术（实现了同一接口）
public class test03 {
    @Test
    public void fun1(){
        UserService us = new UserServiceImpl();
        //创建动态代理工厂
        UserServiceProxyFactory factory = new UserServiceProxyFactory(us);
        //获得动态代理对象
        UserService usProxy = factory.getUserService();
        //调用动态代理对象增强的方法
        usProxy.add();
    }
}
